import {Component, Inject, Optional} from '@angular/core';
import {GnDatetimeUtils, GnMessageService, GnTable} from "geminis-ng";
import {GnTableColumn} from "geminis-ng/data/table.component";
import {HttpClient} from "@angular/common/http";
import {StopProcessComponent} from "../stop/stop-process.component";
import {MAT_DIALOG_DATA} from "@angular/material/dialog";

@Component({
  selector: 'gn-workflow-manager-history-task',
  templateUrl: './history-task.component.html'
})
export class HistoryTaskComponent extends GnTable {

  columns: GnTableColumn[] = [
    {label: '实例号', field: 'id'},
    {label: '名称', field: 'name'},
    {label: '处理人', field: 'assignee'},
    {label: '开始时间', field: 'createTime', formatter: (row: any) => GnDatetimeUtils.format(row.createTime, 'yyyy-MM-dd HH:mm:ss')},
    {label: '结束时间', field: 'endTime', formatter: (row: any) => GnDatetimeUtils.format(row.endTime, 'yyyy-MM-dd HH:mm:ss')}
  ];

  processInstanceId: string;

  constructor(@Optional() @Inject(MAT_DIALOG_DATA) private param: any) {
    super();

    this.processInstanceId = param.id;
  }

}

